package com.ilxqx.framework;

import com.ilxqx.framework.generator.core.CodeGenerator;
import com.ilxqx.framework.generator.core.ModelData;
import com.ilxqx.framework.generator.core.mysql.MysqlModelData;
import com.ilxqx.framework.generator.core.mysql.SimpleMysqlBasedJsCodeGenerator;
import com.ilxqx.framework.generator.core.mysql.SimpleMysqlBasedVueCodeGenerator;
import com.ilxqx.framework.system.service.SysRoleService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

;

@RunWith(SpringRunner.class)
@SpringBootTest
public class FrameworkCodeGenerator {

	@Autowired
	private SysRoleService sysRoleService;

	@Test
	public void doGenerate() {
		ModelData modelData = new MysqlModelData();
//		CodeGenerator codeGenerator = new SimpleMysqlBasedCodeGenerator(modelData);
//		codeGenerator.generate();

		CodeGenerator codeGenerator1 = new SimpleMysqlBasedVueCodeGenerator(modelData);
		codeGenerator1.generate();

		CodeGenerator codeGenerator2 = new SimpleMysqlBasedJsCodeGenerator(modelData);
		codeGenerator2.generate();
	}

	@Test
	public void tt() {
		this.sysRoleService.getList();
		this.sysRoleService.getList();
	}

}
